3 require dirname(__FILE__
) . '/../class.parser.php';
5 class Template_Tester
extends Template_Parser
7 public $debug = array();
9 public function processString($content)
11 $this->debug
[] = array('Processing string', $content);
12 return parent
::processString($content);
15 public function processModifier($name, $content, $arguments, $map_array)
17 $this->debug
[] = array('Processing modifier', $name, $content, $arguments);
18 return parent
::processModifier($name, $content, $arguments, $map_array);
21 public function processVariable($name)
23 $this->debug
[] = array('Processing variable', $name);
24 return parent
::processVariable($name);
27 public function testArgs($args)
29 return $this->parseArguments($args);
33 $test = new Template_Tester
;
35 $args = 'truc="miam $blu\' oh" miam="ah `$bla|blu`" bla=$bla|blu autre=$a|bb|cat:$miam|escape uh=bla::blou()';
37 print_r($test->testArgs($args));
39 foreach (token_get_all('<?php '.$args.'?>') as $line)
44 echo token_name($line[0]) . ": ";
48 echo str_replace("\n", "", print_r($line, true));